<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>非单文件</title>
    <script src="../prototype/dist/vue/vue.js"></script>
</head>
<body>

    <div id="root">
        <school></school>
    </div>
    
    <script>
        Vue.config.productionTip = false
        function Demo() {
            console.log("this=",this);
            this.a = 2
        }
        
        const d = new Demo()
        console.log(Demo.prototype); // 显示原型属性
        console.log(d.__proto__); // 隐式原型属性

        // 程序员通过显示原型属性操作原型对象，追加一个x属性，值为88
        Demo.prototype.x = 88
        console.log("d.__proto__.x==",d.__proto__.x);
        console.log("d.__proto__ === Demo.prototype?",d.__proto__ === Demo.prototype); // true

      const school =   Vue.extend({
            name: "school",
            template:`
            <div>
                <h2>学校名称：{{schoolName}}</h2>    
                <h2>学校地址：{{schoolAddress}}</h2>    
            </div>
            `,
            data(){
                return {
                    schoolName: "家里蹲",
                    schoolAddress: "地球村"
                }
            },
            components:{}
        })
        console.log("school==",school);
     const vm =  new Vue({
          el:"#root",
          data:{
             msg: "你好" 
          },
          components: {
              school
          }
      })
      console.log(school.prototype.__proto__=== Vue.prototype);
    </script>
</body>
</html>